package com.bokee.archerwq.lab.file;

import java.io.File;

/**
 * List all the files and dirs
 * 
 * @author rodney
 * 
 */
public class DirList {

	public static void main(String[] args) {
		dirList(new File("E:"));
	}

	private static void dirList(File file) {
		if (file.exists()) {
			File[] files = file.listFiles();
			for (int i = 0; i < files.length; i++) {
				System.out.println(files[i].getName());
				if (files[i].isDirectory()) {
					// System.out.println(files[i].getName());
					dirList(files[i]);
				} else {
					// System.out.println("    " + files[i].getName());
				}
			}
		}
	}

}
